<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1, user-scalable=no">
    <meta http-equiv="X-UA-Compatible" content="ie=edge,chrome=1">
    <meta name="author" content="胡爱静">
    <title>改变图片的路径</title>
    <style>
        body{
            margin: 0;
        }
        *{
            box-sizing: border-box;
        }
        .box {
             width: 450px; 
            margin: 100px auto;
            border: 2px solid red;
        }
        ul{
            margin: 0;
            padding: 0;
            list-style: none;
        }
        .box .big img{
            width: 300px;
            height: 300px;
            border-radius: 10px;
            margin: 10px 12px;
        }
        .box li img{
            width: 100px;
            height: 100px;
            border-radius: 10px;
            margin: 5px;
        }
        .right-top{
            width: 100px;
            display: flex;
            flex-flow: wrap;
        }
        .bottom{
            width: 100%;
            display: flex;
            flex-flow: wrap; 
        }
        ul{
          display: flex;  
           flex-flow: wrap;  
        }
    </style>
</head>

<body>
    <div class="box">
        
        <ul>
            <div class="big"><img src="../img/big_1.jpg" alt=""></div>
            <div class="right-top">
            <li><img src="../img/small_1.jpg" alt=""></li>
            <li><img src="../img/small_2.jpg" alt=""></li>
            <li><img src="../img/small_3.jpg" alt=""></li>
            </div>
            <div class="bottom">
            <li><img src="../img/small_4.jpg" alt=""></li>
            <li><img src="../img/small_5.jpg" alt=""></li>
            <li><img src="../img/small_6.jpg" alt=""></li>
            <li><img src="../img/small_7.jpg" alt=""></li>
            <li><img src="../img/small_8.jpg" alt=""></li>
            <li><img src="../img/small_9.jpg" alt=""></li>
            <li><img src="../img/small_10.jpg" alt=""></li>
            <li><img src="../img/small_11.jpg" alt=""></li>
            </div>
        </ul>
    </div>
</body>

</html>
<script>
    var big = document.querySelector('.big img');
    var imgs = document.querySelectorAll('li');

    for(var i = 0;i<imgs.length;i++){
        imgs[i].index = i + 1;
          imgs[i].onmouseenter =  function(){
              big.src = '../img/big_'+this.index+'.jpg';
          }
    }






</script>